package com.lovi.admin.utils;

import com.lovi.admin.pojo.AdminUser;
import org.apache.shiro.authc.AuthenticationToken;
public class CustomAuthenticationToken implements AuthenticationToken {

    private AdminUser adminUser;

    public CustomAuthenticationToken(AdminUser adminUser) {
        this.adminUser = adminUser;
    }

    @Override
    public Object getPrincipal() {
        return adminUser.getUserAccount(); // 或者返回adminUser.getId()等作为主要标识
    }

    @Override
    public Object getCredentials() {
        return adminUser.getUserPassword(); // 或者返回加密后的密码等
    }

    // 可以在此处添加获取adminUser对象的方法
    public AdminUser getAdminUser() {
        return adminUser;
    }
}
